package com.bt.dmdb.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "question")
@SuppressWarnings("serial")
public class Question implements java.io.Serializable  {

	 private Long id;
	 private String name;
	 private String category;
	 private String classification;
	 private String questionno;
	 private Set<CustomerQuestion> customerQuestions = new HashSet<CustomerQuestion>(0);
	 
	public Question() {
	}
	public Question(Long id) {
	        this.id = id;
	}

    public Question(Long id, String name) {
	        this.id = id;
	        this.name = name;
	}
	public Question(Long id, String name, String category, String classification,
			String questionno,
			Set<CustomerQuestion> customerQuestions) {
		super();
		this.id = id;
		this.name = name;
		this.category = category;
		this.classification = classification;
		this.customerQuestions = customerQuestions;
		this.questionno = questionno;
	}
	
	@Id
	@GeneratedValue
   // @GeneratedValue(generator = "documentIG", strategy = GenerationType.TABLE)
   // @TableGenerator(name = "documentIG", table = "jpa_sequences", pkColumnName = "name", pkColumnValue = "Document", allocationSize = 10, valueColumnName = "next_hi_value")
	@Column(name = "id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "name", length = 500)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name = "category", length = 100)
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "question")
	public Set<CustomerQuestion> getCustomerQuestions() {
		return customerQuestions;
	}
	public void setCustomerQuestions(Set<CustomerQuestion> customerQuestions) {
		this.customerQuestions = customerQuestions;
	}
	
	@Column(name = "classification", length = 100)
	public String getClassification() {
		return classification;
	}
	public void setClassification(String classification) {
		this.classification = classification;
	}
	
	@Column(name = "questionno", length = 50)
	public String getQuestionno() {
		return questionno;
	}
	public void setQuestionno(String questionno) {
		this.questionno = questionno;
	}
	
}
